﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using DAO;

namespace BUS
{
    public class HanhKhach_BUS
    {
        public static string MaxMaHanhKhach()
        {
            return HanhKhach_DAO.MaHanhKhachMax();
        }

        public static List<HanhKhach_DTO> GetHanhKhachList()
        {
            List<HanhKhach_DTO> listHanhKhach = new List<HanhKhach_DTO>();
            try
            {
                HanhKhach_DAO hanhkhachDAO = new HanhKhach_DAO();
                listHanhKhach = hanhkhachDAO.GetHanhKhachList();
            }
            catch (System.Exception)
            { }
            return listHanhKhach;
        }

        public static HanhKhach_DTO GetHanhKhachDetails(string maHanhKhach)
        {
            HanhKhach_DTO hanhkhachDTO = new HanhKhach_DTO();
            try
            {
                HanhKhach_DAO hanhkhachDAO = new HanhKhach_DAO();
                hanhkhachDTO = hanhkhachDAO.GetHanhKhachDetails(maHanhKhach);
            }
            catch (System.Exception)
            {
            }
            return hanhkhachDTO;
        }

        public static void InsertHanhKhach(HanhKhach_DTO hanhkhachDTO)
        {
            try
            {
                HanhKhach_DAO hanhkhachDAO = new HanhKhach_DAO();
                hanhkhachDAO.InsertHanhKhach(hanhkhachDTO);
            }
            catch
            { }
        }

        public static void UpdateHanhKhach(HanhKhach_DTO hanhkhachDTO)
        {
            try
            {
                HanhKhach_DAO hanhkhachDAO = new HanhKhach_DAO();
                hanhkhachDAO.UpdateHanhKhach(hanhkhachDTO);
            }
            catch
            { }
        }

        public static void DeleteHanhKhach(HanhKhach_DTO hanhkhachDTO)
        {
            try
            {
                HanhKhach_DAO hanhkhachDAO = new HanhKhach_DAO();
                hanhkhachDAO.DeleteHanhKhach(hanhkhachDTO);
            }
            catch
            { }
        }
    }
}
